package 多窗口卖票.利用Thread子类;

/**
 * 需求：创建三个窗口，卖100张票
 */
public class Window extends Thread{

    private static int ticket=100;

    @Override
    public void run() {
       while (true){
           if (ticket > 0) {
               System.out.println(getName()+"卖的票号："+ticket);
               ticket--;
           }else{
               break;
           }
       }
    }
}
